package com.ruoyi.project.modules.parameter.mapper;

import java.util.List;
import com.ruoyi.project.modules.parameter.domain.ParamsFieldRelation;
import com.ruoyi.project.modules.table.domain.TableInfo;
import com.ruoyi.project.modules.virtualUsageParamSource.vo.ObjectParam;
import org.apache.ibatis.annotations.Param;

/**
 * 数据集下面字段关系Mapper接口
 * 
 * @author smallrain
 * @date 2021-10-30
 */
public interface ParamsFieldRelationMapper 
{
    /**
     * 查询数据集下面字段关系
     * 
     * @param id 数据集下面字段关系主键
     * @return 数据集下面字段关系
     */
    public ParamsFieldRelation selectParamsFieldRelationById(Long id);

    /**
     * 查询数据集下面字段关系列表
     * 
     * @param paramsFieldRelation 数据集下面字段关系
     * @return 数据集下面字段关系集合
     */
    public List<ParamsFieldRelation> selectParamsFieldRelationList(ParamsFieldRelation paramsFieldRelation);
    public List<ParamsFieldRelation> selectParamsFieldRelations(ParamsFieldRelation paramsFieldRelation);

    /**
     * 新增数据集下面字段关系
     * 
     * @param paramsFieldRelation 数据集下面字段关系
     * @return 结果
     */
    public int insertParamsFieldRelation(ParamsFieldRelation paramsFieldRelation);

    /**
     * 修改数据集下面字段关系
     * 
     * @param paramsFieldRelation 数据集下面字段关系
     * @return 结果
     */
    public int updateParamsFieldRelation(ParamsFieldRelation paramsFieldRelation);

    /**
     * 删除数据集下面字段关系
     * 
     * @param id 数据集下面字段关系主键
     * @return 结果
     */
    public int deleteParamsFieldRelationById(Long id);

    /**
     * 批量删除数据集下面字段关系
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteParamsFieldRelationByIds(String[] ids);

    int deleteParamsFieldRelationByDataRelationId(@Param("ids") List<Long> ids);

    List<ParamsFieldRelation> selectParamsFieldRelationByDataRelationId(@Param("dataRelationIds") List<Long> dataRelationIds, @Param("dataRelationType") String dataRelationType);

    void removeByInterfaceDataListId(@Param("interfaceListIds")List<Long> interfaceListIds);

    void batchSave(@Param("paramsFieldRelationList") List<ParamsFieldRelation> paramsFieldRelationList);

    List<TableInfo> tableList(@Param("interfaceDataListId") Long interfaceDataListId);

    void updateSort(@Param("paramsFieldRelationList") List<ParamsFieldRelation> paramsFieldRelationList);

    int maxSort(@Param("interfaceParamsFieldRelationId") Long interfaceParamsFieldRelationId);

    void updateFieldDesign(@Param("paramsFieldRelation") ParamsFieldRelation paramsFieldRelation,
                           @Param("ids") List<Long> ids);

    void updateParamsFieldRelationByFieldId(@Param("paramsFieldRelation") ParamsFieldRelation paramsFieldRelation);

    List<ObjectParam> objectParamList(@Param("interfaceDataListId")Long interfaceDataListId);
}
